package com.duobaoyu.dby.supply.biz.client.boundary.auth.bean.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Set;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName BatchRefreshTokenDTO
 * @createTime 15:39:00 2023/10/10
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BatchRefreshTokenDTO implements Serializable {
    private static final long serialVersionUID = -7775485161087891081L;

    private AuthToken authToken;
    /**
     * 渠道编码
     */
    private Set<ChannelInfo> channelInfos;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ChannelInfo {

        /**
         * 渠道编码
         */
        private String channelCode;

        /**
         * 渠道配置唯一Key
         */
        private String configUniqueKey;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AuthToken {

        /**
         * 渠道编码
         */
        private String channelCode;
        /**
         * 渠道配置唯一Key
         */
        private String configUniqueKey;
        /**
         * uid
         */
        private String uid;
        /**
         * 访问令牌
         */
        private String accessToken;
        /**
         * 刷新令牌
         */
        private String refreshToken;
        /**
         * 当前时间，时间戳格式：1551663377887
         */
        private Long time;
        /**
         * access_token的有效期，单位：秒，有效期24小时
         */
        private Long expiresIn;
        /**
         * refresh_token的过期时间，毫秒级别,时间戳
         */
        private Long refreshTokenExpires;

        private String xid;

        private String tokenType;

        private String openId;

        private String scope;
    }
}
